import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: () => import('@/views/login/index.vue'),
      meta: { title: '登录页' }
    },
    {
      path: '/ssologin',
      component: () => import('@/views/login/ssologin.vue'),
      meta: { title: '单点登录页' }
    },
    {
      path: '/',
      component: () => import('@/layout/index.vue'),
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: () => import('@/views/home/index.vue'),
          meta: { title: '首页' }
        },

        {
          path: '/courseDetails',
          component: () => import('@/views/home/courseDetail.vue'),
          meta: { title: '课程详情页' }
        },
        {
          path: '/play',
          component: () => import('@/views/home/play.vue'),
          meta: { title: '播放页' }
        }
      ]
    },
    {
      path: '/lookMore',
      component: () => import('@/views/home/lookMore.vue'),
      meta: { title: '查看更多' }
    },
    {
      path: '/codePage',
      component: () => import('@/H5Wapp/codePage.vue'),
      meta: {
        title: 'H5应用'
      }
    },
    {
      path: '/courseDetail',
      component: () => import('@/views/onlineLecture/Playdetails.vue'),
      meta: {
        title: '播放'
      }
    }
  ]
})

export default router
